/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-12-12
 * Time: 上午11:19
 * To change this template use File | Settings | File Templates.
 */
Ext.define('Airways.view.system.userrole.UserRoleRight',{
    extend:'Ext.grid.Panel',
    alias:'widget.userRoleRight',
    selModel:Ext.create('Ext.selection.CheckboxModel'),
    store:'system.role.RoleManageStore',
    layout:'fit',
    autoScroll:true,
    height:'100%',
    initComponent:function(){
        this.dockedItems = this.buildDockedItems();
        this.columns = this.buildColumns();
        this.callParent(arguments);
    },
    buildDockedItems:function(){
        return [{
            dock: 'top',
            xtype: 'toolbar',
            items:['-',{
                 xtype:'button',
                 iconCls:'savebutton',
                 text:'保存关联',
                 disable:true,
                 action:'save'
             },'-']
        }];
    },
    buildColumns:function(){
        return [
            Ext.create('Ext.grid.RowNumberer'),
            {text:'角色编号',dataIndex:'roleNo',width:150},
            {text:'角色名称',dataIndex:'roleName',width:150},
            {text:'角色描述',dataIndex:'roleDesc',width:200},
            {text:'状态',dataIndex:'status',renderer:this.changeStatus,flex:1}
        ];
    },
    changeStatus:function(val) {
        if (val == 0) return "禁用";
        if (val == 1) return "启用";
    }
});

